﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Globalization;

namespace spktNhom4DoAnCuoiKy
{
    public partial class DateTimePicker : System.Web.UI.UserControl
    {
        string height,width,id;
        DateTime value= DateTime.MinValue;
        public string Height {
            get { return TextBox1.Height.ToString(); }
            set { TextBox1.Height = Unit.Parse(value); }
        }
        public string Width
        {
            get { return TextBox1.Width.ToString(); }
            set { TextBox1.Width = Unit.Parse(value); }
        }
       
        public DateTime Value
        {
            get {
                try
                {
                    return DateTime.ParseExact(TextBox1.Text, "dd/MM/yyyy HH:mm", CultureInfo.InvariantCulture);
                }
                catch (Exception ex)
                {
                    return DateTime.MinValue;
                }
            
            }
            
        }
        public string Text
        {
            get { return TextBox1.Text; }
            set { TextBox1.Text = value; }
        }
        public string ValidationGroup
        {
            get
            {
                return RequiredFieldText.ValidationGroup;
            }
            set
            {
                RequiredFieldText.ValidationGroup = value;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
    }
}